from machine import Pin,PWM
import time
class duoji:
    def __init__(self):
        self.pwm=PWM(Pin(10,Pin.OUT))
        self.pwm.freq(50)        
    def zhuan(self,c):
        ts = int((c/90+0.5)*51.15)
        self.pwm.duty(ts)